#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2024, Henrik Hose
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------

def init(module):
    module.name = ":driver:as5047"
    module.description = """\
# AS5047 14 bit Absolute Encoder SPI Driver

[Datasheet](https://ams.com/documents/20143/36005/AS5047D_DS000394_2-00.pdf)
"""

def prepare(module, options):
    module.depends(
        ":architecture:gpio",
        ":architecture:spi.device",
        ":processing:resumable",
        ":math:geometry"
    )
    return True

def build(env):
    env.outbasepath = "modm/src/modm/driver/encoder"
    env.copy("as5047.hpp")
    env.copy("as5047_impl.hpp")
